<?php

namespace App\Model\DesignPattern\Creational\Behavioral\Memento;

class Editor
{
    protected $context = '';

    public function add($content)
    {
        $this->context = $this->context. ' ' .$content;
    }

    public function getContent()
    {
        return $this->context;
    }

    public function save()
    {
        return new EditorMemento($this->context);
    }

    public function restore(EditorMemento $editorMemento)
    {
        $this->context = $editorMemento;
    }
}
